iOS_SikuliTest.sikuli

(Download this script)
setAutoWaitTimeout(10000)

val = getFindFailedResponse()
if val == ABORT:
    print "Abort"
if val == SKIP:
    print "SKIP"
if val == PROMPT:
    print "PROMPT"
if val == RETRY:
    print "RETRY"

def common_test(a,b,c):
    for i in range(a,b):
        wait(c)
        if exists():
            click()

#ActionTest
click()
print("Run ActionsTest")
common_test(1,28,1.0)
click(Pattern().targetOffset(-93,0))
common_test(1,3,3.0)
common_test(1,6,1.0)
print("ActionsTest finished!")
click()

#TransitionsTest
click()
print("Run TransitionsTest")
common_test(1,27,1.0)
print("TransitionsTest finished!")
click(Pattern().targetOffset(49,0))

#ActionsProgressTest
click()
print("Run ActionsProgressTest")
common_test(1,8,1.0)
print("ActionsProgressTest finished!")
click()


#EffectsTest
click()
print("Run EffectsTest")
common_test(1,22,3.0)
print("Effects finished!")
click()

#ClickAndMoveTest
print("Run ClickAndMoveTest")
click()
wait(4)
click()
click(Pattern().targetOffset(200,-3))
click()

print("ClickAndMoveTest finished!")

#RotateWorldTest
print("Run RotateWorldTest")
click()
wait(4)
click()
print("RotateWorldTest finished!")

#ParticleTest
print("Run ParticleTest")
click()
common_test(1,43,2.0)
print("ParticleTest finished!")
click()

dragDrop(Pattern().targetOffset(91,17), Pattern().targetOffset(93,-19))

#ActionEaseTest
print("Run ActionEaseTest")
click()
common_test(1,14,2.0)
click()
print("ActionEaseTest finished!")

#MotionStreakTest
print("Run MotionStreakTest")
click()
wait(1.0)
click(Pattern().targetOffset(20,0))
wait(1.0)
click()
dragDrop(, )
click(Pattern().targetOffset(20,0))
dragDrop(, )
click()
click(Pattern().targetOffset(20,0))
wait(1.0)
click()
print("MotionStreakTest finished!")

#DrawPimitivesTest
print("Run DrawPimitivesTest")
click()
if exists():
    print("DrawPrimitivesTest success!")
print("DrawPimitivesTest finished!")
click()

#NodeTest
print("Run NodeTest")
click()
common_test(1,14,1.0)
click()
print("NodeTest finished!")

#TouchesTest
print("Run TouchesTest")
click()
wait(1.0)
click()
print("TouchesTest finished!")

#MenuTest
print("Run MenuTest")
click()
click()
click()
click()
click()
click()
click()
click()
click()
print("MenuTest finished!")

#ActionManagerTest
print("Run ActionManagerTest")
click()
common_test(1,5,3.0)
click()
print("ActionManagerTest finished!")

#LayerTest
print("Run LayerTest")
click()
dragDrop(, )
click()
wait(1.0)
click()
wait(1.0)
click()
dragDrop(, )
common_test(1,3,1.0)
click()
print("LayerTest finished!")

dragDrop(Pattern().targetOffset(98,6), Pattern().targetOffset(106,-11))

#SceneTest
print("Run SceneTest")
click()
click()
click()
click()
click()
click()
print("SceneTest finished!")

#ParallaxTest
print("Run ParallaxTest")
click()
wait(3.0)
click()
dragDrop(, )
click()
print("ParallaxTest finished!")

#TileMapTest
print("Run TileMapTest")
click()
common_test(1,21,2.0)
click()
print("TileMapTest finished!")

#IntervalTest
print("Run IntervalTest")
click()
wait(2.0)
click()
wait(1.0)
click()
click()
print("IntervalTest finished!")

#ChipmunkAccelTouchTest
print("Run ChipmunkAccelTouchTest")
click()
for i in range(1,3):
    click()
for i in range(1,3):
    click()
wait(3.0)
click()
print("ChipmunkAccelTouchTest finished!")

#LabelTest
print("Run LabelTest")
click()
wait(1.0)
common_test(1,26,0.5)
click()
print("LabelTest finished!")

#TextInputTest
print("Run TextInputTest")
click()
type(, "1q~<?;\@")
click()
click()
type(, "1q~<?;\@")
click()
click()
print("TextInputTest finished!")

dragDrop(Pattern().targetOffset(100,14), Pattern().targetOffset(75,-8))

#SpriteTest
print("Run SpriteTest")
click()
for i in range(1,3):
    click()
for j in range(1,3):
    click()
click()
for i in range(1,3):
    click()
for j in range(1,3):
    click()
common_test(1,100,0.5)
click()
print("SpriteTest finished!")

#SchdulerTest
print("Run SchdulerTest")
click()
wait(1.0)
click()
dragDrop(Pattern().targetOffset(23,0),Pattern().targetOffset(-50,0))
click()
dragDrop(,Pattern().targetOffset(58,0))
common_test(1,11,1)
click()
print("SchdulerTest finished!")

#RenderTextureTest
print("Run RenderTextureTest")
click()
dragDrop(, )
dragDrop(, )
click()
click()
click()
wait(1.0)
click()
click()
click()
click()
click()
wait(1.0)
click()
print("RenderTextureTest finished!")

#Texture2DTest
print("Run Texture2DTest")
click()
common_test(1,36,0.5)
click()
print("Texture2DTest finished!")

#Box2dTest
print("Run Box2dTest")
click()
for i in range(1,6):
    click()
for i in range(1,6):
    click()
click()
print("Box2dTest finished!")

#Box2dTestBed
print("Run Box2dTestBed")
click()
common_test(1,36,2.0)
click()
print("Box2dTestBed finished!")

#EffectAdvancedTest
print("Run EffectAdvancedTest")
click()
common_test(1,6,1.0)
click()
print("EffectAdvancedTest finished!")

#Accelerometer
print("Run Accelerometer")
click()
click()
print("Accelerometer finished!")

dragDrop(Pattern().targetOffset(120,2), Pattern().targetOffset(130,-9))

#KeypadTest
print("Run KeypadTest")
click()
click()
print("KeypadTest finished!")

#CocosDenshionTest
print("Run CocosDenshionTest")
click()
click()
click()
click()
click()
click()
click()
click()
dragDrop(Pattern().targetOffset(-130,15), Pattern().targetOffset(-140,-15))
click()
click()
click()
click()
click()
click()
click()
click()
dragDrop(Pattern().targetOffset(-120,6), Pattern().targetOffset(-130,-9))
click()
click()
click()
click()
click()
click()
click()
click()
print("CocosDenshionTest finished!")

#PerformanceTest
print("Run PerformanceTest")
click()
click()
click()
common_test(1,6,0.5)
click()
click()
click()
common_test(1,5,0.5)
click()
click()
common_test(1,5,0.5)
click()
click()
click()
click()
click()
click()
click()
click()
click()
click()
click()
print("PerformanceTest finished!")

#ZwoptexTest
print("Run ZwoptexTest")
click()
click()
print("ZwoptexTest finished!")

#CurlTest
print("Run CurlTest")
click()
click()
click()
print("CurlTest finished!")

#UserDefaultTest
print("Run UserDefaultTest")
click()
click()
print("UserDefaultTest finished!")

#BugsTest
print("Run BugsTest")
click()
click()
click()
click()
click()
click()
click()
click()
click()
click()
click()
click()
click()
click()
click()
click()
click()
dragDrop(Pattern().targetOffset(-103,16), Pattern().targetOffset(-100,-19))
click()
click()
click()
wait(0.5)
click()
click()
print("BugsTest finished!")

dragDrop(Pattern().targetOffset(-110,17), Pattern().targetOffset(-120,-9))

#FontTest
print("Run FontTest")
click()
common_test(1,6,0.5)
click()
print("FontTest finished!")

#CurrentLauguageTest
print("Run CurrentLauguageTest")
click()
click()
print("CurrentLauguageTest finished!")

#TextureCacheTest
print("Run TextureCacheTest")
click()
click()
print("TextureCacheTest finished!")

#ExtensionsTest
print("Run ExtensionsTest")
click()
click()
click()
click()
click()
wait(0.5)
dragDrop(Pattern().targetOffset(-120,0),Pattern().targetOffset(120,0))
click()
click()
click()
click(Pattern().targetOffset(-19,0))
click()
click()
click()
click()
click()
click()
click()
click()
click()
click()
click()
click()
click()
click()
click()
click()
click()
click()
click()
click()
click()
print("ExtensionsTest finished!")

#ShaderTest
print("Run ShaderTest")
click()
common_test(1,7,0.5)
wait(0.5)
dragDrop(Pattern().targetOffset(-44,0),Pattern().targetOffset(80,0))
click()
click()
print("ShaderTest finished!")

#MutiTouchTest
print("Run MutiTouchTest")
click()
for i in range(1,3):
    dragDrop(, )
    dragDrop(, Pattern().targetOffset(-50,0))
click()
print("MutiTouchTest finished!")

#Quit
print("Quit")
click()